import React from 'react'
import './index.scss'

class LittleButton extends React.PureComponent {
  render() {
    const {
      onClick,
      title,
      width, height,
      className,
      disabled,
    } = this.props;

    const style = {};
    if (width) { style.width = `${width / 75}rem`; }
    if (height) { style.height = `${height / 75}rem`; }

    return (
      <button
        type="button"
        onClick={onClick}
        className={`${className} ${disabled ? 'disabled-little-button' : ''}`}
        style={style}
        disabled={disabled}
      >
        { title || '默认文字' }
      </button>
    )
  }
}

export default LittleButton

